<html>
    <head>
        <meta charset="utf-8">
        <title>计算器</title>
        <link rel="stylesheet" href="css/index.css">
        <script>
            function init(){
                num=document.getElementById('num');
                num.disabled="disabled";
                num.value="0";
              var input=document.getElementsByTagName("input");
              score=0;
              char="";
            }
            //判断长度
            function isNull(n){
                return (n=="0"||n.length==0);
            }
            //正负转变
            function sign(n){
                if(Number(n)){
                    n=n*-1;
                }else{
                    n=n;
                }
                return n;
            }
            //减少一位
            function reduce(n){
                n=n.substr(0,n.length-1);
                if(n=="0"||n.length==0){
                    n="0";
                }
                return n;
            }
            //加小数点
            function point(n){
                if(n.indexOf(".")==-1){
                    n=n+".";
                }else{
                    n=n;
                }
                return n;
            }
        </script>
    </head>
    <body onload="init(),imooc()">
        <div class="content">
            <div class="top">
                <input type="text" name="" id="num" value="">
            </div>
            <div class="bottom">
                <input type="button" name="" id="" value="" />
                <input type="button" name="" id="" value="←" />
                <input type="button" name="" id="" value="+/-" />
                <input type="button" name="" id="" value="/" />
                <input type="button" name="" id="" value="1" />
                <input type="button" name="" id="" value="2" />
                <input type="button" name="" id="" value="3" />
                <input type="button" name="" id="" value="*" />
                <input type="button" name="" id="" value="4" />
                <input type="button" name="" id="" value="5" />
                <input type="button" name="" id="" value="6" />
                <input type="button" name="" id="" value="-" />
                <input type="button" name="" id="" value="7" />
                <input type="button" name="" id="" value="8" />
                <input type="button" name="" id="" value="9" />
                <input type="button" name="" id="" value="+" />
                <input type="button" name="" id="" value="0" />
                <input type="button" name="" id="" value="." />
                <input type="button" name="" id="" value="=" />
                <input type="button" name="" id="imooc" value="m" />
            </div>
        </div>
    </body>
</html>